package com.rzcf.blink.pay.domain.repository;

import com.rzcf.blink.pay.domain.model.entity.PayOrderEntity;

/**
 * @author dongsufeng
 * @description:
 * @date 2025-09-13 14:38
 */
public interface PayOrderRepository {

    /**
     * 订单初始化
     *
     * @param payOrderId
     * @param payOrder
     * @return
     */
    boolean updateInit2Ing(String payOrderId, PayOrderEntity payOrder);

    /**
     * 更新订单为支付中
     *
     * @param payOrderId
     * @param channelOrderNo
     * @param channelUserId
     * @return
     */
    boolean updateIng2Success(String payOrderId, String channelOrderNo, String channelUserId);

    /**
     * 订单支付失败
     *
     * @param payOrderId
     * @return
     */
    boolean updateIng2Close(String payOrderId);

    /**
     *
     * @param payOrderId
     * @return
     */
    boolean updateInit2Close(String payOrderId);

    /**
     * 订单支付中-》成功失败
     *
     * @param payOrderId
     * @param channelOrderNo
     * @param channelUserId
     * @param channelErrCode
     * @param channelErrMsg
     * @return
     */
    boolean updateIng2SuccessOrFail(String payOrderId, Integer updateState, String channelOrderNo, String channelUserId, String channelErrCode, String channelErrMsg);

    /**
     * 查询商户订单
     *
     * @param mchNo
     * @param payOrderId
     * @param mchOrderNo
     * @return
     */
    PayOrderEntity queryMchOrder(String mchNo, String payOrderId, String mchOrderNo);

    /**
     * 查询订单
     *
     * @param payOrderId
     * @return
     */
    PayOrderEntity queryById(String payOrderId);
}
